package com.jic.member.service;

import com.jic.common.base.vo.Page;
import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.member.entity.MememberUser;
import com.jic.member.request.*;
import com.jic.member.response.DistributorShareResponse;
import com.jic.member.response.MemberInfoResponse;
import com.jic.member.response.MememberUserForMarketResponse;
import com.jic.member.response.MememberUserResponse;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * 会员信息表
 *
 * @author :
 * @version : v1.0.0
 * @email :
 * @since : 2020-04-16 11:20:10
 */
public interface MememberUserService {

    long insert(MememberUser mememberUser);

    long delete(Long id);

    long update(MememberUser mememberUser);

    long updateMemberUserInfo(MememberUser mememberUser);

    MememberUser queryByPrimaryKey(Long id);

    List<MememberUser> query(MememberUser mememberUser);


    /**
     * 查询会员列表
     * 需要注意的是【mem_member_user】表中的dept_id是无效的；所以关联的【mem_member_action】表来锁定平台Id；
     *
     * @param mememberUser 请求入参
     * @return 返回封装的实体来
     * @author tzc
     * @date 2020-7-10 19:31:51
     */
    List<MememberUser> listMemberUserInfoInDeptIds(MememberUser mememberUser);

    PageResult<MememberUser> queryPage(MememberUser mememberUser, Page pageQuery);

//    PageResult<MememberUser> queryPages(MememberUser mememberUser, Page pageQuery);

    /**
     * description: 根据用户id查询用户组所有用户
     *
     * @author: jackHe
     * @time: 2020/6/11 20:12
     */
    PageResult<MememberUser> queryUserGroupPage(MememberUser mememberUser, Page pageQuery);

    List<String> queryUserHeadInfo(MememberUserRequest form);

    /**
     * 通过标签枚举查询用户
     *
     * @param labelRequest
     * @return
     */
    List<String> queryByLabelType(LabelRequest labelRequest);


    long batchUpdateMemberUser(MememberUser mememberUser);

    /**
     * description: 查询会员手机号码
     *
     * @return
     * @author: jackHe
     * @time: 2020/6/30 16:02
     */
    RestResult<List<MememberUserResponse>> queryUserInfoByPhone(MememberUser mememberUser);

    /**
     * 为活动中心提供会员列表接口
     *
     * @param request 请求参数
     * @return 响应参数
     * @author tzc
     * @date 2020-7-2 22:07:45
     */
    RestResult<List<MememberUserForMarketResponse>> listMemberUserInfoForMarket(MememberUserForMarketRequest request);

    /**
     * 为活动中心提供会员列表接口
     *
     * @param request 请求参数
     * @return 响应参数
     * @author zxl
     * @date 2020-7-8 22:07:45
     */
    RestResult memberUserInfoForMarket(MememberForMarket request);

    List<MememberUserResponse> queryMemberByPhone(String phoneList);

    RestResult register(String phone,String inviteCode);

    RestResult<DistributorShareResponse> queryDistributorShare(DistributorShareRequest request);


    PageResult<MememberUser> queryDistributionMemberPage(MememberUser memberRequest, Page page);


    PageResult<MememberUser> listRestPage(MememberUser mememberUser, Page pageQuery);

    /**
     * 添加上级下级
     *
     * @param request
     * @return
     */
    RestResult<Boolean> addHigherOrLower(@RequestBody DistributionRestRequest request);

    List<MememberUserResponse> queryByThirdUserIds(String userIds);

    List<MememberUserResponse> listPage(MememberUserRequest user);

    Long updateMember(MememberUserRequest request);

    RestResult<Map<String, Long>> queryRegisteredCount(MememberUserRequest request);

    RestResult<List<MememberUserResponse>> queryRegistered(MememberUserRequest request);

    RestResult<MemberInfoResponse> aggregationUserInfo(MememberInfoRequest request);

    Boolean updateStatus(MememberUserRequest form);

    List<MememberUserResponse> count();
}
